function TbBalanceStatistics(params){ 
	 
}

TbBalanceStatistics.Where = function(type,proxy){
	this.type = type;
	this.proxy=proxy;
	this.linked = null;
	this.set = null;
	if(this.type==0){
		this.set = new TbBalanceStatistics.Where(1,true);
		this.set.linked = this;
	}
	this.getProxy = function(){
		var m = new TbBalanceStatistics.Where(this.type);//当前的对像
		if(this.type==0){
			m.set = new TbBalanceStatistics.Where(1,true);//set对象
			m.set.linked = m;
		}else{
			m.linked=this.linked;
			this.linked.linked=m;
		}
		return m;
	}
	this.data = {};
	this.put = function(key,value){
		this.data[key] = value;
	}
	this.get = function(key){
		return this.data[key];
	}
	/** 编号 [非空]       **/
	this.tbbsId=function(tbbsId){if(this.proxy)return this.getProxy().tbbsId(tbbsId);  this.put("tbbsId", tbbsId);return this;};
	/** and tbbs_id is null */
	this.tbbsIdNull=function(){if(this.proxy)return this.getProxy().tbbsIdNull();if(this.get("tbbsIdNot")==null)this.put("tbbsIdNot", "");this.put("tbbsId", null);return this;};
	/** not .... */
	this.tbbsIdNot=function(){if(this.proxy)return this.getProxy().tbbsIdNot();this.put("tbbsIdNot", "not");return this;};
	this.tbbsIdNotNull=function(){if(this.proxy)return this.getProxy().tbbsIdNotNull();this.put("tbbsIdNot", "not");this.put("tbbsId", null);return this;};
	this.tbbsIdNot=function(tbbsId){if(this.proxy)return this.getProxy().tbbsIdNot(tbbsId);this.put("tbbsIdNot", "not");this.put("tbbsId", tbbsId);return this;};
	/** and tbbs_id <= ? */
	this.tbbsIdMin=function(min){if(this.proxy)return this.getProxy().tbbsIdMin(min);this.put("tbbsIdMin", min);return this;};
	/** and tbbs_id >= ? */
	this.tbbsIdMax=function(max){if(this.proxy)return this.getProxy().tbbsIdMax(max);this.put("tbbsIdMax", max);return this;};
	this.tbbsIdIn=function(ids){
		if(this.proxy)return this.getProxy().tbbsIdIn(ids);  this.put("tbbsIdIn", ids);return this;
	};	
	
	/** 品牌  [Merchant]      **/
	this.tbbsBrand=function(tbbsBrand){if(this.proxy)return this.getProxy().tbbsBrand(tbbsBrand);  this.put("tbbsBrand", tbbsBrand);return this;};
	/** and tbbs_brand is null */
	this.tbbsBrandNull=function(){if(this.proxy)return this.getProxy().tbbsBrandNull();if(this.get("tbbsBrandNot")==null)this.put("tbbsBrandNot", "");this.put("tbbsBrand", null);return this;};
	/** not .... */
	this.tbbsBrandNot=function(){if(this.proxy)return this.getProxy().tbbsBrandNot();this.put("tbbsBrandNot", "not");return this;};
	this.tbbsBrandNotNull=function(){if(this.proxy)return this.getProxy().tbbsBrandNotNull();this.put("tbbsBrandNot", "not");this.put("tbbsBrand", null);return this;};
	this.tbbsBrandNot=function(tbbsBrand){if(this.proxy)return this.getProxy().tbbsBrandNot(tbbsBrand);this.put("tbbsBrandNot", "not");this.put("tbbsBrand", tbbsBrand);return this;};
	/** and tbbs_brand <= ? */
	this.tbbsBrandMin=function(min){if(this.proxy)return this.getProxy().tbbsBrandMin(min);this.put("tbbsBrandMin", min);return this;};
	/** and tbbs_brand >= ? */
	this.tbbsBrandMax=function(max){if(this.proxy)return this.getProxy().tbbsBrandMax(max);this.put("tbbsBrandMax", max);return this;};
	this.tbbsBrandIn=function(ids){
		if(this.proxy)return this.getProxy().tbbsBrandIn(ids);  this.put("tbbsBrandIn", ids);return this;
	};	
	
	/** 上月余量        **/
	this.tbbsOldMonthMargin=function(tbbsOldMonthMargin){if(this.proxy)return this.getProxy().tbbsOldMonthMargin(tbbsOldMonthMargin);  this.put("tbbsOldMonthMargin", tbbsOldMonthMargin);return this;};
	/** and tbbs_old_month_margin is null */
	this.tbbsOldMonthMarginNull=function(){if(this.proxy)return this.getProxy().tbbsOldMonthMarginNull();if(this.get("tbbsOldMonthMarginNot")==null)this.put("tbbsOldMonthMarginNot", "");this.put("tbbsOldMonthMargin", null);return this;};
	/** not .... */
	this.tbbsOldMonthMarginNot=function(){if(this.proxy)return this.getProxy().tbbsOldMonthMarginNot();this.put("tbbsOldMonthMarginNot", "not");return this;};
	this.tbbsOldMonthMarginNotNull=function(){if(this.proxy)return this.getProxy().tbbsOldMonthMarginNotNull();this.put("tbbsOldMonthMarginNot", "not");this.put("tbbsOldMonthMargin", null);return this;};
	this.tbbsOldMonthMarginNot=function(tbbsOldMonthMargin){if(this.proxy)return this.getProxy().tbbsOldMonthMarginNot(tbbsOldMonthMargin);this.put("tbbsOldMonthMarginNot", "not");this.put("tbbsOldMonthMargin", tbbsOldMonthMargin);return this;};
	/** and tbbs_old_month_margin <= ? */
	this.tbbsOldMonthMarginMin=function(min){if(this.proxy)return this.getProxy().tbbsOldMonthMarginMin(min);this.put("tbbsOldMonthMarginMin", min);return this;};
	/** and tbbs_old_month_margin >= ? */
	this.tbbsOldMonthMarginMax=function(max){if(this.proxy)return this.getProxy().tbbsOldMonthMarginMax(max);this.put("tbbsOldMonthMarginMax", max);return this;};
	this.tbbsOldMonthMarginIn=function(ids){
		if(this.proxy)return this.getProxy().tbbsOldMonthMarginIn(ids);  this.put("tbbsOldMonthMarginIn", ids);return this;
	};	
	
	/** 本月购量        **/
	this.tbbsNowMonthBuy=function(tbbsNowMonthBuy){if(this.proxy)return this.getProxy().tbbsNowMonthBuy(tbbsNowMonthBuy);  this.put("tbbsNowMonthBuy", tbbsNowMonthBuy);return this;};
	/** and tbbs_now_month_buy is null */
	this.tbbsNowMonthBuyNull=function(){if(this.proxy)return this.getProxy().tbbsNowMonthBuyNull();if(this.get("tbbsNowMonthBuyNot")==null)this.put("tbbsNowMonthBuyNot", "");this.put("tbbsNowMonthBuy", null);return this;};
	/** not .... */
	this.tbbsNowMonthBuyNot=function(){if(this.proxy)return this.getProxy().tbbsNowMonthBuyNot();this.put("tbbsNowMonthBuyNot", "not");return this;};
	this.tbbsNowMonthBuyNotNull=function(){if(this.proxy)return this.getProxy().tbbsNowMonthBuyNotNull();this.put("tbbsNowMonthBuyNot", "not");this.put("tbbsNowMonthBuy", null);return this;};
	this.tbbsNowMonthBuyNot=function(tbbsNowMonthBuy){if(this.proxy)return this.getProxy().tbbsNowMonthBuyNot(tbbsNowMonthBuy);this.put("tbbsNowMonthBuyNot", "not");this.put("tbbsNowMonthBuy", tbbsNowMonthBuy);return this;};
	/** and tbbs_now_month_buy <= ? */
	this.tbbsNowMonthBuyMin=function(min){if(this.proxy)return this.getProxy().tbbsNowMonthBuyMin(min);this.put("tbbsNowMonthBuyMin", min);return this;};
	/** and tbbs_now_month_buy >= ? */
	this.tbbsNowMonthBuyMax=function(max){if(this.proxy)return this.getProxy().tbbsNowMonthBuyMax(max);this.put("tbbsNowMonthBuyMax", max);return this;};
	this.tbbsNowMonthBuyIn=function(ids){
		if(this.proxy)return this.getProxy().tbbsNowMonthBuyIn(ids);  this.put("tbbsNowMonthBuyIn", ids);return this;
	};	
	
	/** 本月兑换        **/
	this.tbbsNowMonthSend=function(tbbsNowMonthSend){if(this.proxy)return this.getProxy().tbbsNowMonthSend(tbbsNowMonthSend);  this.put("tbbsNowMonthSend", tbbsNowMonthSend);return this;};
	/** and tbbs_now_month_send is null */
	this.tbbsNowMonthSendNull=function(){if(this.proxy)return this.getProxy().tbbsNowMonthSendNull();if(this.get("tbbsNowMonthSendNot")==null)this.put("tbbsNowMonthSendNot", "");this.put("tbbsNowMonthSend", null);return this;};
	/** not .... */
	this.tbbsNowMonthSendNot=function(){if(this.proxy)return this.getProxy().tbbsNowMonthSendNot();this.put("tbbsNowMonthSendNot", "not");return this;};
	this.tbbsNowMonthSendNotNull=function(){if(this.proxy)return this.getProxy().tbbsNowMonthSendNotNull();this.put("tbbsNowMonthSendNot", "not");this.put("tbbsNowMonthSend", null);return this;};
	this.tbbsNowMonthSendNot=function(tbbsNowMonthSend){if(this.proxy)return this.getProxy().tbbsNowMonthSendNot(tbbsNowMonthSend);this.put("tbbsNowMonthSendNot", "not");this.put("tbbsNowMonthSend", tbbsNowMonthSend);return this;};
	/** and tbbs_now_month_send <= ? */
	this.tbbsNowMonthSendMin=function(min){if(this.proxy)return this.getProxy().tbbsNowMonthSendMin(min);this.put("tbbsNowMonthSendMin", min);return this;};
	/** and tbbs_now_month_send >= ? */
	this.tbbsNowMonthSendMax=function(max){if(this.proxy)return this.getProxy().tbbsNowMonthSendMax(max);this.put("tbbsNowMonthSendMax", max);return this;};
	this.tbbsNowMonthSendIn=function(ids){
		if(this.proxy)return this.getProxy().tbbsNowMonthSendIn(ids);  this.put("tbbsNowMonthSendIn", ids);return this;
	};	
	
	/** 本月剩余        **/
	this.tbbsNowMonthSurplus=function(tbbsNowMonthSurplus){if(this.proxy)return this.getProxy().tbbsNowMonthSurplus(tbbsNowMonthSurplus);  this.put("tbbsNowMonthSurplus", tbbsNowMonthSurplus);return this;};
	/** and tbbs_now_month_surplus is null */
	this.tbbsNowMonthSurplusNull=function(){if(this.proxy)return this.getProxy().tbbsNowMonthSurplusNull();if(this.get("tbbsNowMonthSurplusNot")==null)this.put("tbbsNowMonthSurplusNot", "");this.put("tbbsNowMonthSurplus", null);return this;};
	/** not .... */
	this.tbbsNowMonthSurplusNot=function(){if(this.proxy)return this.getProxy().tbbsNowMonthSurplusNot();this.put("tbbsNowMonthSurplusNot", "not");return this;};
	this.tbbsNowMonthSurplusNotNull=function(){if(this.proxy)return this.getProxy().tbbsNowMonthSurplusNotNull();this.put("tbbsNowMonthSurplusNot", "not");this.put("tbbsNowMonthSurplus", null);return this;};
	this.tbbsNowMonthSurplusNot=function(tbbsNowMonthSurplus){if(this.proxy)return this.getProxy().tbbsNowMonthSurplusNot(tbbsNowMonthSurplus);this.put("tbbsNowMonthSurplusNot", "not");this.put("tbbsNowMonthSurplus", tbbsNowMonthSurplus);return this;};
	/** and tbbs_now_month_surplus <= ? */
	this.tbbsNowMonthSurplusMin=function(min){if(this.proxy)return this.getProxy().tbbsNowMonthSurplusMin(min);this.put("tbbsNowMonthSurplusMin", min);return this;};
	/** and tbbs_now_month_surplus >= ? */
	this.tbbsNowMonthSurplusMax=function(max){if(this.proxy)return this.getProxy().tbbsNowMonthSurplusMax(max);this.put("tbbsNowMonthSurplusMax", max);return this;};
	this.tbbsNowMonthSurplusIn=function(ids){
		if(this.proxy)return this.getProxy().tbbsNowMonthSurplusIn(ids);  this.put("tbbsNowMonthSurplusIn", ids);return this;
	};	
	
	/** 修改时间        **/
	this.tbbsUpdateTime=function(tbbsUpdateTime){if(this.proxy)return this.getProxy().tbbsUpdateTime(tbbsUpdateTime);  this.put("tbbsUpdateTime", tbbsUpdateTime);return this;};
	/** and tbbs_update_time is null */
	this.tbbsUpdateTimeNull=function(){if(this.proxy)return this.getProxy().tbbsUpdateTimeNull();if(this.get("tbbsUpdateTimeNot")==null)this.put("tbbsUpdateTimeNot", "");this.put("tbbsUpdateTime", null);return this;};
	/** not .... */
	this.tbbsUpdateTimeNot=function(){if(this.proxy)return this.getProxy().tbbsUpdateTimeNot();this.put("tbbsUpdateTimeNot", "not");return this;};
	this.tbbsUpdateTimeNotNull=function(){if(this.proxy)return this.getProxy().tbbsUpdateTimeNotNull();this.put("tbbsUpdateTimeNot", "not");this.put("tbbsUpdateTime", null);return this;};
	this.tbbsUpdateTimeNot=function(tbbsUpdateTime){if(this.proxy)return this.getProxy().tbbsUpdateTimeNot(tbbsUpdateTime);this.put("tbbsUpdateTimeNot", "not");this.put("tbbsUpdateTime", tbbsUpdateTime);return this;};
	/** and tbbs_update_time >= ? */
	this.tbbsUpdateTimeStart=function(start){if(this.proxy)return this.getProxy().tbbsUpdateTimeStart(start);this.put("tbbsUpdateTimeStart", start);return this;};			
	/** and tbbs_update_time <= ? */
	this.tbbsUpdateTimeEnd=function(end){if(this.proxy)return this.getProxy().tbbsUpdateTimeEnd(end);this.put("tbbsUpdateTimeEnd", end);return this;};
	
	
	
	this.add=function(key,value) {if(proxy)return proxy().add(key,value);this.put(key, value);return this;}
	this.desc=function(sql) {if(proxy)return proxy().desc(sql);this.put("desc", sql);return this;}
	this.asc=function(sql) {if(proxy)return proxy().asc(sql);this.put("asc", sql);return this;}
	this.definex=function(sql) {if(proxy)return proxy().definex(sql);this.put("definex", sql);return this;}
	
	/** 获取所有余额产品统计 **/
	this.list=function(size){
		this.data.size = size;
		var protocol = ux.ajax("/admin/products/tbbalancestatistics.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data && protocol.data.list)return protocol.data.list;
		return [];
	}
	/** 获取余额产品统计分页 **/
	this.page=function(page,size){
		this.data.size = size;
		this.data.page = page;
		var protocol = ux.ajax("/admin/products/tbbalancestatistics.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data)return data;
		return {list:[]};
	}
	/** 根据查询条件取余额产品统计 **/
	this.get=function(){
		this.data.size = 1;
		var protocol = ux.ajax("/admin/products/tbbalancestatistics.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data && protocol.data.list && protocol.data.list.length==1)return protocol.data.list[0]; 
		return null;
	}
}

TbBalanceStatistics.get = function(id){
	var protocol = ux.ajax("/admin/products/tbbalancestatistics.get.do",{id:id});
	if(!protocol)return null;
	if(protocol.data)return protocol.data.tbBalanceStatistics;
	return null;
}

TbBalanceStatistics.where = new TbBalanceStatistics.Where(0,true);